<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <script>

        var name = 'zs';
        var user = {
            name,
            age: 20,
            getName(){
                return this.name;
            }
        }
        console.log(user.name)


    </script>
</body>
</html>